package com.crm.jdy.common.dto;


import com.baomidou.mybatisplus.annotation.*;
import com.crm.jdy.common.pojo.PermissionInfo;
import com.crm.jdy.common.vo.PageVO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Set;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class RoleInfoDto  extends PageVO implements Serializable {

    private static final long serialVersionUID = 1617029393L;


    @TableId(value = "role_id", type = IdType.ID_WORKER_STR)
    @ApiModelProperty(name = "roleId" , value = "角色主键id")
    private String roleId;

    @NotNull(message = "用户id不能为空")
    @ApiModelProperty(name = "userId" , value = "用户id")
    private String userId;

    @ApiModelProperty(name = "roleIsAdmin" , value = "用户是否为管理员")
    private String roleIsAdmin;

    @JsonIgnore
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @ApiModelProperty(name = "createTime" , value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @JsonIgnore
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @ApiModelProperty(name = "updateTime" , value = "更新最新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @JsonIgnore
    @TableLogic
    @ApiModelProperty(name = "isDelete" , value = "0正常  1删除")
    private Integer isDelete;

    @ApiModelProperty(name = "roleCrePerson" , value = "创建人")
    private String roleCrePerson;

    @ApiModelProperty(name = "roleUpdPerson" , value = "更新人")
    private String roleUpdPerson;

    @ApiModelProperty(name = "roleName" , value = "角色")
    private String roleName;

//   获取用户的权限信息
    private Set<PermissionInfo> infoSet;

}
